package dal.object.rocks;

import gui.PlayersMap;
import gui.event.Collision;

import java.awt.image.BufferedImage;

import dal.FileIO;
import dal.object.Rock;
import dal.object.tools.Brush;

public class Invisible extends Rock {
	private static final BufferedImage pic = FileIO.readPic(path + "uveg.png");
	private static final BufferedImage inv = FileIO.readPic(path + "lathatatlan.png");
	private boolean visible;
	
	public Invisible() {
		img = inv;
		visible = false;
	}
	
	public void touch(Collision cld){
		super.touch(cld);
	}
	
	public void impact(Collision cld){
		super.impact(cld);
		
		if(PlayersMap.ball.hasTool(Brush.class) && !visible){
			setVisible(true);
		}
	}
	
	public void setVisible(boolean vis){
		if(vis){
			img = pic;
		} else {
			img = inv;
		}
		
		visible = vis;
		repaint();
	}
	
	public BufferedImage getImage(){
		return pic;
	}
}
